package accounting.controller.ajax;

import java.io.PrintWriter;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.json.JSONObject;
import org.springframework.web.servlet.view.AbstractView;

import accounting.trade.model.vo.BlanceVO;

public class JSonCheckBlanceView extends AbstractView{

	@Override
	protected void renderMergedOutputModel(Map map,
			HttpServletRequest request, HttpServletResponse response) throws Exception {
		Set set = map.keySet();
		Iterator itr = set.iterator();
		BlanceVO vo=(BlanceVO) map.get(itr.next());
		JSONObject obj=new JSONObject();
		System.out.println(vo);
		obj.put("sumprice", vo.getSumprice());
		obj.put("blance", vo.getOpening_blance());
		response.setContentType("text/html;charset=euc-kr");
		response.setHeader("Cache-Control", "no-cache");
		PrintWriter out = response.getWriter();
		out.println(obj.toString());
		out.close();
	}
	
}
